<html>
	<head>
    	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    </head>
	<body>
        <form action="forsikringsberegner.php">
            <table border="1">
                <tr>
                    <th>Køn</th>
                    <td><input type="text" name="gender"/></td>
                </tr>
                <tr>
                    <th>Alder</th>
                    <td><input type="text" name="age"/></td>
                </tr>
                <tr>
                    <th>Gift</th>
                    <td><input type="text" name="status"/></td>
                </tr>
                <tr>
                	<td><input type="submit" /></td>
    	<?php
			if(isset($_REQUEST["gender"],$_REQUEST["age"],$_REQUEST["status"])){
				$pris = 500;
				$gender = $_REQUEST["gender"];
				$age = $_REQUEST["age"];
				$status = $_REQUEST["status"];
				if($gender=="mand" && $age<25 && $status=="nej"){
					$pris = $pris + 1500;
				}
				if($gender=="kvinde" || $status=="ja"){
					$pris = $pris - 200;
				}
				if($age>=46 && $age<=64){
					$pris = $pris - 100;
				}
				echo "<td>Pris = $pris</td></table>";
			}
		?>
        <footer>&copy; Frederik Mattern</footer>
    </body>
</html>